<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var isPalindrome = function (x) {
        let str_x = x + '';
        let i;
        for (i = 0; i < parseInt(str_x.length / 2); i++) {
            if (str_x[i] != str_x[str_x.length - 1 - i]) {
                return false;
            } else {
                continue;
            }
        }
        if (i == parseInt(str_x.length / 2)) {
            return true;
        }
    };
    console.log(10, isPalindrome(10))
    console.log(100, isPalindrome(100))
    console.log(-100, isPalindrome(-100))
    console.log(0, isPalindrome(0))
    console.log(10, isPalindrome(10))
    console.log(212, isPalindrome(212))
    console.log(121211, isPalindrome(121211))
</script>

</html>